class Solution:
    def compareVersion(self, version1: str, version2: str) -> int:
        v1 = list(map(int, version1.split('.')))
        v2 = list(map(int, version2.split('.')))
        if len(v2) < len(v1):
            v2 += [0] * (len(v1) - len(v2))
        elif len(v1) < len(v2):
            v1 += [0] * (len(v2) - len(v1))
        for i in range(len(v1)):
            if v1[i] < v2[i]:
                return -1
            elif v2[i] < v1[i]:
                return 1
        return 0


if __name__ == '__main__':
    s = Solution()
    r = s.compareVersion(version1="1.2", version2="1.10")
    print(r)
